cmake_minimum_required (VERSION 3.8.0)                     #规定cmake的最低版本要求
set(C_STANDARD 11)
project(MySwap)                                             #项目的名称，不一定和你的文件夹名称一样
# set(CMAKE_C_COMPILER gcc)
# set(CMAKE_CXX_COMPILER g++)
set(CMAKE_BUILD_TYPE "Debug")                               #打断点调试代码必设置，Cmake默认是Release会导致断点失效
include_directories(${PROJECT_SOURCE_DIR}/source ${PROJECT_SOURCE_DIR}/source/Lib ${PROJECT_SOURCE_DIR}/source/Haier
 ${PROJECT_SOURCE_DIR}/source/BodyComp ${PROJECT_SOURCE_DIR}/source/cJson ${PROJECT_SOURCE_DIR}/source/Unity 
 ${PROJECT_SOURCE_DIR}/source/flexible_button ${PROJECT_SOURCE_DIR}/source/Jump ${PROJECT_SOURCE_DIR}/source/Log 
 ${PROJECT_SOURCE_DIR}/source/TelinkHistory ${PROJECT_SOURCE_DIR}/source/weight ${PROJECT_SOURCE_DIR}/source/Test
 ${PROJECT_SOURCE_DIR}/source/static_buffer ${PROJECT_SOURCE_DIR}/source/tinyfs)       #添加头文件的搜索路径
#要用的cpp文件有哪些地址就要添加源文件路径
aux_source_directory(./source  SrcFiles)                                            #将源文件列表写在变量SrcFiles中
aux_source_directory(./source/BodyComp  BodyCompSrcFiles)                           #将源文件列表写在变量BodyCompSrcFiles中
aux_source_directory(./source/cJson  JsonSrcFiles)                                  #将源文件列表写在变量JsonSrcFiles中
aux_source_directory(./source/flexible_button  ButtonSrcFiles)                      #将源文件列表写在变量JsonSrcFiles中
aux_source_directory(./source/Haier HaierSrcFiles)                                  #将源文件列表写在变量SrcFilesHaier中
aux_source_directory(./source/Unity UnitySrcFiles)                                  #工程项目较大，要创建多个模块
aux_source_directory(./source/Jump JumpSrcFiles)                                    #工程项目较大，要创建多个模块
aux_source_directory(./source/weight weightSrcFiles)                                #工程项目较大，要创建多个模块
aux_source_directory(./source/Test TestSrcFiles)                                    #工程项目较大，要创建多个模块
aux_source_directory(./source/Log LogSrcFiles)                                      #工程项目较大，要创建多个模块
aux_source_directory(./source/TelinkHistory TelinkHistorySrcFiles)                  #工程项目较大，要创建多个模块
aux_source_directory(./source/static_buffer StaticBufferSrcFiles)                   #工程项目较大，要创建多个模块
aux_source_directory(./source/tinyfs tinyfsSrcFiles)                                #工程项目较大，要创建多个模块
set(EXECUTABLE_OUTPUT_PATH  ${PROJECT_SOURCE_DIR}/build)        #设置可执行文件输出路径
add_executable(main ${SrcFiles} ${BodyCompSrcFiles} ${JsonSrcFiles} ${ButtonSrcFiles} ${HaierSrcFiles} 
${UnitySrcFiles} ${JumpSrcFiles} ${weightSrcFiles} ${TestSrcFiles} ${LogSrcFiles} ${TelinkHistorySrcFiles}
${StaticBufferSrcFiles} ${tinyfsSrcFiles})           #设置可执行文件的名称，make之后build目录下出现main.exe
#set (CMAKE_CXX_FLAGS “${CMAKE_CXX_FLAGS} -g”)               #debug 使用否者屏蔽

